/**
    File        : Options.h
    Description : Global application settings
    Author      : Raymond Marsh
    Created     : 08/01/2009
    Copyright 2009, 2010, 2011, 2012 Raymond Marsh

    This program is distributed under the terms of the GNU General Public License.
    To view a copy of the license see the file 'copying.txt'

    This file is part of the MyMoney Suite.

    MyMoney is free software: you can redistribute it and/or modify it under
    the terms of the GNU General Public License as published by the Free Software Foundation, either
    version 3 of the License, or (at your option) any later version.

    MyMoney is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
    without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License along with MyMoney.
    If not, see <http://www.gnu.org/licenses/>.
**/

#ifndef SETTINGS_H_INCLUDED
#define SETTINGS_H_INCLUDED

//(* wxWidgets includes
#include <wx/config.h>
#include <wx/confbase.h>
#include <wx/fileconf.h>
#include <wx/wfstream.h>
#include <wx/string.h>
#include <wx/stdpaths.h>
#include <wx/colour.h>
//*)

//(* C/C++ includes
//*)

//(* other includes
#include "../common/stdafx.h"
//*)

//(* defines
//*)

//(* constants
//*)

struct SGlobal
{
    bool      FirstRun;
    bool      HideReconciledTransactionsOnStart;
    int       Language;
};

struct SColors
{
    wxColour  MainBGColor;
    wxColour  DialogBGColor;
};

struct SFontSizes
{
    int       RegisterFontSize;
};

struct SLogin
{
    wxString  DefaultUserName;
    wxString  DefaultPassword;
};

struct SMySQL
{
    bool      UseLocalConnection;
};

struct SWarnings
{
    bool      UseCategory;
};

namespace mm
{
class COptions
{
    public:
    COptions() { }
    ~COptions() { SaveOptions(); }
    bool Initialize();
    bool LoadOptions();
    bool SaveOptions();
    bool RestoreDefaults();

    SGlobal    GLOBAL;
    SColors    COLORS;
    SFontSizes FONTSIZES;
    SWarnings  WARNINGS;
    SLogin     LOGIN;
    SMySQL     MYSQL;

    private:
    // default settings
    wxColour          m_DefaultMainBGColor;
    wxColour          m_DefaultDialogBGColor;
    bool              m_DefaultHideReconciledTransactionsOnStart;
    bool              m_DefaultLanguage;
    int               m_DefaultRegisterFontSize;
};

extern COptions* g_pOptions;

}; // end namespace mm


#endif // SETTINGS_H_INCLUDED
